{extend name='public/content'}

{block name="title"}
	保存用户信息
{/block}

{block name="body"}
	
{foreach($list as $vo)}
	ajax 提保存到用户列表 地址： http://ysbl.com/index.php/index/activiy/setuseractiveiy.html?id=38
		<div class="layui-container">  
				{$vo.name}
		  <div class="layui-row">
		    <div class="layui-col-md3">
		     	{$vo.goods_id}
		    </div>
		    <div class="layui-col-md3">
		  		 {$vo.money}
		    </div>
		    <div class="layui-col-md3">
		  		 {$vo.use_start_time}
		    </div>
		    <div class="layui-col-md3">
		  		 {$vo.use_end_time}
		    </div>
		    <div class="layui-col-md3">
		  		 {$vo.condition}
		    </div>
		    <div class="layui-col-md3">
		  		<img src="{$vo.img}" style="width: 100px;height: 100px">
		    </div>
		    <button data-id="{$vo.id}" class="getycard">点击领取优惠券</button>
		  </div>
		 </div>
{/foreach}
{/block}

{block name="script"}
 	<script type="text/javascript">
 		require(['jquery'], function () {
 			$('.getycard').click(function(){
 			    var geycardurl ="{:url('activiy/setuseractiveiy')}";
 				var that =$(this);
 				$.ajax({
 					url: geycardurl,
 					type: 'GET',
 					dataType: 'json',
 					data: {id: that.data('id')},
 				})
 				.done(function(data) {
 					if(data.status==3){
 						alert(data.msg);
 					}
 				})
 				.fail(function() {
 					console.log("error");
 				})
 				.always(function() {
 					console.log("complete");
 				});	
 			})
 		})
 			
 	</script>
{/block}

{block name="style"}
 <style type="text/css">
 	
 </style>
{/block}